/**
 * Created by YMP on 2019/10/24.
 */
import {env} from './index'
// 开发
const develop = {
  baseURL: 'http://localhost:3000/'
}
// 测试
const test = {
  baseURL: 'http://localhost:3000/'
}

// 预发
const prepub = {
  baseURL: 'http://localhost:3000/'
}
// 线上
const production = {
  baseURL: 'http://localhost:3000/'
}

export const urlConfig =() => {
  const mode = process.env.NODE_ENV === 'production' ? 'pro' : env === 'pro' ? 'pro': env
  switch (mode) {
    case 'pro':
      return production
    case 'pre':
      return prepub
    case 'test':
      return test
    case 'dev':
      return develop
    default:
      return develop
  }
}
